

static void initFence() {
    float FencePost[] = {
        0, 0, 0, //back face
        1, 0, 0,
        0, 1, 0,
        1, 1, 0,
        0, 0, 1, //front face
        1, 0, 1,
        0, 1, 1,
        1, 1, 1,
        0, 0, 0, //left face
        0, 0, 1,
        0, 1, 0,
        0, 1, 1,
        1, 0, 0, //right face
        1, 0, 1,
        1, 1, 0,
        1, 1, 1,
        0, 0, 0, //bottom
        1, 0, 0,
        1, 0, 1,
        0, 0, 1,
        0, 1, 0, //top
        0, 1, 1,
        1, 1, 0,
        1, 1, 1
    };
    
    float FenceNormal[] = {
        0, 0, -1,
        0, 0, -1,
        0, 0, -1,
        0, 0, -1,
        0, 0, 1,
        0, 0, 1,
        0, 0, 1,
        0, 0, 1,
        -1, 0, 0,
        -1, 0, 0,
        -1, 0, 0,
        -1, 0, 0,
        1, 0, 0,
        1, 0, 0,
        1, 0, 0,
        1, 0, 0,
        0, -1, 0,
        0, -1, 0,
        0, -1, 0,
        0, -1, 0,
        0, 1, 0,
        0, 1, 0,
        0, 1, 0,
        0, 1, 0
    };
    
    unsigned short fenceIdx[] = {0, 1, 3, 0, 2, 3, 4, 5, 7, 4, 6, 7, 8, 9, 11, 8, 10, 11, 12, 13, 15, 12, 14, 15, 16, 17, 18, 16, 18, 19, 20, 21, 23, 20, 22, 23};
    
    g_FiboLen = 36;
    glGenBuffers(1, &FenceBuffObj);
    glBindBuffer(GL_ARRAY_BUFFER, FenceBuffObj);
    glBufferData(GL_ARRAY_BUFFER, sizeof(FencePost), FencePost, GL_STATIC_DRAW);
    
    glGenBuffers(1, &FenceNormalBuffObj);
    glBindBuffer(GL_ARRAY_BUFFER, FenceNormalBuffObj);
    glBufferData(GL_ARRAY_BUFFER, sizeof(FenceNormal), FenceNormal, GL_STATIC_DRAW);
    
    glGenBuffers(1, &FIndxBuffObj);
    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, FIndxBuffObj);
    glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(fenceIdx), fenceIdx, GL_STATIC_DRAW);
    
}


void drawFence(float x, float y, float z, float ang){
    ModelTrans.pushMatrix();
        ModelTrans.translate(vec3(x, y, z));
        ModelTrans.scale(.1);
        ModelTrans.rotate(ang, vec3(0, 1, 0));
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 1, .5));
            ModelTrans.scale(10, 1, 1);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 3, .5));
            ModelTrans.scale(10, 1, 1);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 5, .5));
            ModelTrans.scale(10, 1, 1);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(12, 0, 0));
            ModelTrans.scale(2, 7, 2);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.scale(2, 7, 2);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
    SetModel();
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    
    ModelTrans.popMatrix();
}

void drawGate(float x, float y, float z, float ang) {
    ModelTrans.pushMatrix();
        ModelTrans.translate(vec3(x, y, z));
        ModelTrans.scale(.1);
        ModelTrans.rotate(ang, vec3(0, 1, 0));
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 1, .5));
            ModelTrans.scale(10, 1, 1);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 3, .5));
            ModelTrans.scale(10, 1, 1);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.rotate(-30, vec3(0, 0, 1));
            ModelTrans.translate(vec3(-4, 7, .5));
            ModelTrans.scale(14, 1, 1);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 5, .5));
            ModelTrans.scale(10, 1, 1);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(12, 1, 0));
            ModelTrans.scale(2, 5, 2);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.scale(2, 9, 2);
            SetModel();
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
    SetModel();
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
}

void drawTree(float x, float y, float z) {
    ModelTrans.pushMatrix();
        ModelTrans.translate(vec3(x, y, z));
        ModelTrans.scale(.1);
        ModelTrans.pushMatrix();
            ModelTrans.scale(3, 8, 3);
            SetModel();
            SetMaterial(3);
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(-3, 8, -3));
            ModelTrans.scale(9);
            SetModel();
            SetMaterial(2);
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();            
    
    SetModel();
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    
    ModelTrans.popMatrix();
}

void drawCow(float x, float y, float z, float ang) {
    ModelTrans.pushMatrix();
        ModelTrans.translate(vec3(x, y, z));
        ModelTrans.scale(.1);
        ModelTrans.translate(vec3(0, 3, 0));
        ModelTrans.pushMatrix();
            ModelTrans.scale(.5, 3, .5);
            SetModel();
            SetMaterial(5);
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 0, 0));
            ModelTrans.scale(.5, 3, .5);
            SetModel();
            SetMaterial(5);
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(0, 0, 3));
            ModelTrans.scale(.5, 3, .5);
            SetModel();
            SetMaterial(5);
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix();
        ModelTrans.pushMatrix();
            ModelTrans.translate(vec3(2, 0, 3));
            ModelTrans.scale(.5, 3, .5);
            SetModel();
            SetMaterial(5);
            glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
        ModelTrans.popMatrix()
    
    SetModel();
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    
    ModelTrans.popMatrix();
}


void drawHouse(float x, float y, float z, float ang) {
    ModelTrans.pushMatrix();
    ModelTrans.translate(vec3(x, y, z));
    ModelTrans.scale(.25);
    ModelTrans.rotate(ang, vec3(0, 1, 0));
    ModelTrans.pushMatrix();
    //back
    ModelTrans.translate(vec3(0, 0, 0));
    ModelTrans.scale(12, 12, .5);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    ModelTrans.pushMatrix();
    //left
    ModelTrans.rotate(90, vec3(0, 1, 0));
    ModelTrans.translate(vec3(,,));
    ModelTrans.scale(.5, 12, 12);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    ModelTrans.pushMatrix();
    //right
    ModelTrans.rotate(90, vec3(0, 1, 0));
    ModelTrans.translate(vec3(,,));
    ModelTrans.scale(.5, 12, 12);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    ModelTrans.pushMatrix();
    //front
    ModelTrans.translate(vec3(,,));
    ModelTrans.scale(12, 6, .5);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    ModelTrans.pushMatrix();
    ModelTrans.translate(vec3(,,));
    ModelTrans.scale(5, 6, .5);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    ModelTrans.pushMatrix();
    ModelTrans.translate(vec3(,,));
    ModelTrans.scale(5, 6, .5);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    ModelTrans.pushMatrix();
    //floor
    ModelTrans.translate(vec3(,,));
    ModelTrans.scale(12, .5, 12);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    ModelTrans.pushMatrix();
    //ceiling
    ModelTrans.translate(vec3(,,));
    ModelTrans.scale(12, .5, 12);
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    ModelTrans.popMatrix();
    
    
    ModelTrans.popMatrix();
    SetModel();
    SetMaterial(1);
    glDrawElements(GL_TRIANGLES, g_FiboLen, GL_UNSIGNED_SHORT, 0);
    
    ModelTrans.popMatrix();
}










